<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h4{
            color: fuchsia;
        }
    </style>
</head>
<body>
    <div id="app">
        <div v-for="(item,index) in timearr">
            <p>{{index+1}}时间戳：{{item}}</p>
            <h4>转换后：{{item | toChange(1)}}</h4>
        </div>
    </div>

    <script src="js/vue.js"></script>
    <script>
        let app = new Vue({
            el:"#app",
            data:{
                timearr:['1579657789851','1563516693000','1578539380000']
            },
            filters:{
                "toChange":function(val , el){
                    console.log(val,el);
                    let time = new Date(Number(val));
                    let year = time.getFullYear();
                    let month = time.getMonth()+1;
                    let day = time.getDate();
                    let hour = time.getHours();
                    let min = time.getMinutes();
                    let sec = time.getSeconds();
                    return year+'年'+month+"月"+day+"日"+"  "+hour+":"+min+":"+sec;
                }
            }
        })
    </script>
</body>
</html>